Skip to content

fix(database): publish and restore consistent population checkpoints - #586

Open
Cookie0103 wants to merge 2 commits into
algorithmicsuperintelligence:mainfrom
Cookie0103:fix/consistent-population-checkpoints
Open

Cookie0103 wants to merge 2 commits into
algorithmicsuperintelligence:mainfrom
Cookie0103:fix/consistent-population-checkpoints

Conversation

@Cookie0103

Copy link
Copy Markdown

A failed checkpoint save can leave unchanged metadata pointing to overwritten program code. Reloading also scans stale program files and merges them into the live database, so even a saved empty population can resurrect removed programs.

Publish checkpoints through one atomic metadata manifest referencing immutable program and artifact objects. Load the exact population into independent state before replacing the running database. Restore prompts and sampling state, keep large artifacts portable, and update the visualizer, trace extractors and comparison example to read the same committed snapshot. Durable adds reuse unchanged object references and serialize only the new program. Retention failures after publication are logged as cleanup warnings, preserving successful save/add outcomes and matching memory/disk populations.

Legacy checkpoints remain readable. New checkpoints require this version of OpenEvolve; older releases cannot read the versioned format. Immutable versions are retained so concurrent readers of an older manifest can finish safely.

Diff: 1,264 changed lines across 11 files: 527 runtime, 715 tests, 22 documentation.

Validation:

  • Native public save/load regressions fail on main and pass after the repair; real process-interruption and concurrent reader/writer cases pass.
  • 127 focused tests and 18 subtests pass. Required full unit discovery: 1104 tests, OK, 2 skipped.
  • New helper passes strict mypy; database has no new type diagnostics against main. Black/isort checks pass for core/test changes. The comparison example retains its pre-existing whole-file Black discrepancy to avoid unrelated formatting changes.
  • 100/1000-program durable-add benchmark: exactly one serialized record per add; means 0.513/0.706 ms versus 0.109/0.179 ms on main. No provider calls or live-LLM tests.

Independent review approved the final commit after the post-publication retention fix.

The two existing test adjustments preserve their assertions while making checkpoint fixtures independent and checking the actual active population, rather than requiring evicted programs to be resurrected.

AI assistance: Codex investigated, implemented and tested this change autonomously with the account owner's authorization. The account owner has not personally reviewed or tested the code.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants